package Demo01;

import function.*;
import user.Administrator;
import user.NormalUser;
import user.User;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        System.out.println("请输入你的名字");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入你的身份:>" +
                "1.管理员" +
                "others.常规用户");
        int num = scanner.nextInt();
        User user;
        Func[] func;
        if(num==1) {
            user = new Administrator();
            func = new Func[]{
                    new Exit(),
                    new Find(),
                    new Add(),
                    new Delete()
            };
        } else {
            user = new NormalUser();
            func = new Exit();
                    new Exit(),
                    new Find(),
                    new Delete(),
                    new Return()

        }
        while (true) {
            user.menu();
            System.out.println("请输入你的操作:>");
            int tmp = scanner.nextInt();
            if(tmp==0) {
                break;
            }

        }
    }
}
